package com.example.freeengine.filetranslate.persistence.factory;

import android.content.Context;

import androidx.room.Room;

import com.example.freeengine.filetranslate.persistence.database.FileTranslateDatabase;

/**
 * @author Terry Deng
 */
public class FileTranslateDatabaseFactory {

    static FileTranslateDatabase fileTranslateDatabase;

    public static synchronized FileTranslateDatabase getFileTranslateProgressDatabase(Context context, String dbName){
        if (fileTranslateDatabase == null){
            fileTranslateDatabase = Room.databaseBuilder(context, FileTranslateDatabase.class, dbName).build();
        }
        return fileTranslateDatabase;
    }

}
